//
//  DKLoanDetailSigleCell.m
//  DanKU
//
//  Created by 蓝鳍互娱 on 2023/12/7.
//

#import "DKLoanDetailSigleCell.h"
static NSString * DKLoanDetailSigleCellId = @"DKLoanDetailSigleCellId";
@interface DKLoanDetailSigleCell()
@property (nonatomic,strong) UILabel *dk_LoanDetailSigleHeadLab;
@property (nonatomic,strong) UILabel *dk_LoanDetailSigleValueLab;
@end
@implementation DKLoanDetailSigleCell
+ (instancetype)authLoanDetailSigleCell:(UITableView *)tableView{
    DKLoanDetailSigleCell * dk_LoanDetailSigleCell = [tableView dequeueReusableCellWithIdentifier:DKLoanDetailSigleCellId];
    if (!dk_LoanDetailSigleCell) {
        dk_LoanDetailSigleCell = [[DKLoanDetailSigleCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:DKLoanDetailSigleCellId];
    }
    dk_LoanDetailSigleCell.backgroundColor = [UIColor clearColor];
    dk_LoanDetailSigleCell.selectionStyle = UITableViewCellSelectionStyleNone;
    dk_LoanDetailSigleCell.accessoryType = UITableViewCellAccessoryNone;
    return dk_LoanDetailSigleCell;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self dk_addSubView];
    }
    return self;
}
- (void)dk_addSubView{
    self.dk_LoanDetailSigleHeadLab = [[UILabel alloc] init];
    self.dk_LoanDetailSigleHeadLab.textColor = DK_Hex(@"#CCCCCC");
    self.dk_LoanDetailSigleHeadLab.font = DK_FONT_Regular(17);
    self.dk_LoanDetailSigleHeadLab.numberOfLines = 0;
    [self.contentView addSubview:self.dk_LoanDetailSigleHeadLab];
    [self.dk_LoanDetailSigleHeadLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(DK_IsWidthScale(20)));
        make.top.equalTo(@(DK_IsWidthScale(5)));
//        make.bottom.equalTo(@(DK_IsWidthScale(0)));
//        make.width.equalTo(@(DK_SCREEN_W/2 - DK_IsWidthScale(20)));
    }];
    self.dk_LoanDetailSigleValueLab = [[UILabel alloc] init];
    self.dk_LoanDetailSigleValueLab.textColor = DK_Hex(@"#333333");
    self.dk_LoanDetailSigleValueLab.font = DK_FONT_Regular(17);
    self.dk_LoanDetailSigleValueLab.textAlignment = NSTextAlignmentRight;
    self.dk_LoanDetailSigleValueLab.numberOfLines = 0;
    [self.contentView addSubview:self.dk_LoanDetailSigleValueLab];
    [self.dk_LoanDetailSigleValueLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dk_LoanDetailSigleHeadLab.mas_right).offset(DK_IsWidthScale(20));
        make.right.equalTo(@(-DK_IsWidthScale(20)));
        make.top.equalTo(@(DK_IsWidthScale(5)));
//        make.bottom.equalTo(@(DK_IsWidthScale(0)));
    }];
}
-(void)setDk_LoanDetailPairsMdl:(DKLoanDetailPairsModel *)dk_LoanDetailPairsMdl{
    _dk_LoanDetailPairsMdl = dk_LoanDetailPairsMdl;
    self.dk_LoanDetailSigleHeadLab.text = _dk_LoanDetailPairsMdl.key;
    self.dk_LoanDetailSigleValueLab.text = _dk_LoanDetailPairsMdl.value;
}
@end
